from ..api.get import Get
from ..api.post import Post
from ..util.get_data import GetData


class Test(GetData):
    def setup_method(self):
        self.get = Get()
        self.post = Post()

    def test_delete(self):
        USERID = "aew"
        r = self.get.delete(USERID=USERID)
        assert r.json()["errmsg"] == "deleted"

    def test_add(self):
        userid = self.member_name()
        name = userid
        mobile = self.member_phone_number()
        department = 1
        r = self.post.add(userid, name, mobile, department)
        assert r.json()["errmsg"] == "created"

    def test_update(self):
        userid = "aew"
        name = self.member_name()
        r = self.post.update(userid, name)
        assert r.json()["errmsg"] == "updated"
